package com.turtle3d.user.grammars;

import com.turtle3d.formallanguage.grammar.Grammar;
import com.turtle3d.formallanguage.parser.SimpleParser;
import com.turtle3d.formallanguage.symbol.Symbol;
import com.turtle3d.formallanguage.symbol.SymbolFactory;

public class SierpinskiPyramid extends Grammar {

	@Override
	public void define() {

		setAxiom(SymbolFactory.getSymbolFactory().createSymbolofClass("B"));

		addProduction(SimpleParser
				.parseProduction("B->\\\\[+F+[--//B]+F+[----//B]+F+[++//B]+F+[//B]++/F\\--//B]"));
		addProduction(SimpleParser.parseProduction("F->FF"));

	}

	@Override
	public void setRequiredParameters() {
		setRequiredParameter(Symbol.TURN_ANGLE, 45f);
		setRequiredParameter(Symbol.PITCH_ANGLE, 45f);
	}

}
